// File:		compCMD.h
// Version:		1.0b
// Written by:	ChinJohn Wang (cjwang@esit.com)
// Date:		Jan 17,2011
// Description:	This file contains the skeleton C header file code for implementing the cmptCMD.cpp file

#include <jaus.h>		// JAUS message set (USER: JAUS libraries must be installed first)
#include <openJaus.h>	// Node managment functions for sending and receiving JAUS messages (USER: Node Manager must be installed)
#include <stdlib.h>
#include "cmptLIF.h"	//Science Instrument Structure/format

#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif

#define siOCU_FRAME_RATE_HZ     (2.0)
#define MAX_ADDRESS_SIZE		(16) 
#define QUERY_IMAGE_TIMEOUT		(10)


typedef struct
{
	JausAddress			lifAddress;
	wavelengthData		wlData;
	bool				liveLIF;
	bool				queryImage;
	bool				dataReady;
	JausState			lifState;
	time_t				lastActive;
	time_t				queryTimeOut;
} ocuDataStruct;
typedef ocuDataStruct* ocuData;

// Functions
OjCmpt ocuCreate(void);
void ocuStateProc(OjCmpt ocu);
void ocuReportImageMessageCallback(OjCmpt ocu, JausMessage report);
void ocuReportStatusMessageCallback(OjCmpt ocu, JausMessage report);
ocuData ocuDataCreate(void);

void	requirLIFstatus(OjCmpt ocu);
void	queryLIFdata(OjCmpt ocu);

JausAddress StringtoJausAddr(const char str[MAX_ADDRESS_SIZE]);


